<?php

require_once 'Basic.php';

class FormFieldPassword extends FormFieldType {
  
  public function __construct() {
    $this->htmlClass = "passwdField";
    $this->htmlId = null;
    $this->inputSize = 30;
  }
  
  public function clearHtmlClass() {
    $this->htmlClass = "passwdField";
  }

  public function getHtml($name, $value) {
    return "<input type='password' " . $this->commonAttributes() . " name='${name}'" .
           ($value === null ? "" : " value='${value}'") . ">";
  }

  public function validate($input) {
    if($input !== "") {
      return true;
    }
    else {
      return "A senha n&atilde;o pode ser vazia.";
    }
  }
  
}

?>
